package com.qqb.service.impl;

import com.qqb.dao.PaperTypeDao;
import com.qqb.pojo.PaperType;
import com.qqb.service.PaperTypeService;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PaperTypeServiceImpl implements PaperTypeService {

    @Resource
    private PaperTypeDao paperTypeDao;

    @Override
    public List<PaperType> findAll() {
        return paperTypeDao.selectAll();
    }


    @Override
    public String findNameByCode(String code) {
        PaperType paperType = new PaperType();
        paperType.setCode(code);
        PaperType paperType1 = paperTypeDao.selectByPrimaryKey(paperType);
        if (paperType1 != null) {
            return paperType1.getPaperType();
        } else {
            return "";
        }

    }
}
